Skip to content

fix(desktop): show Continue when a raw nsec is loaded in the backup restore dialog - #6649

Open
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:fix/desktop-backup-restore-raw-nsec
Open

fix(desktop): show Continue when a raw nsec is loaded in the backup restore dialog#6649
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:fix/desktop-backup-restore-raw-nsec

Conversation

@BradGroux

Copy link
Copy Markdown
Contributor

Note: This is a replacement for PR #5308, which was accidentally closed when branches were force-pushed after a commit identity rewrite. The changes are identical, rebased onto the latest main.

Summary

The backup-file restore dialog accepts .key files containing a raw nsec1 private key. The file parser loads the key and displays "Nostr identity found" with the derived npub, but the submit button only rendered when mode === "key" or isPasswordStage (ncryptsec). A raw nsec in mode="backup" satisfies neither condition, so the user sees a recognized identity with no Continue button — a dead end with no forward action.

Add isValid to the submit button's render guard so a valid raw nsec shows the Continue button regardless of mode. The button's existing disabled={!isValid} check prevents submission of invalid input, and keyImportSubmitEnabled already validates the nsec by deriving its npub.

Related issue

Fixes #5261.

Testing

  • Desktop Biome, file-size, text-size, and pubkey-truncation checks passed.
  • TypeScript typecheck and production Vite build passed.
  • Full Tauri test suite passed: 2,270 tests, 0 failures, 14 ignored.
  • Desktop JS test suite passed.

…estore dialog

The backup-file restore dialog (mode="backup") accepts .key files
containing a raw nsec1 key. The file parser loads the key and shows
"Nostr identity found" with the derived npub, but the submit button
only rendered when mode === "key" or isPasswordStage (ncryptsec). A
raw nsec in backup mode satisfies neither condition, so the user sees
a recognized identity with no forward action — a dead end.

Add isValid to the render guard so a valid raw nsec shows the Continue
button regardless of mode. The button's disabled={!isValid} check
already prevents submission of invalid input.

Closes block#5261.

Co-authored-by: Brad Groux <brad@digitalmeld.com>
Signed-off-by: Brad Groux <brad@digitalmeld.com>
Signed-off-by: dm-builder <f01486f036641ccb52c11bb1e0ff2346ea89a8b4e3b49cd772249948f6fcbae6@digitalmeld.communities.buzz.xyz>
Signed-off-by: Brad Groux <bradgroux@hotmail.com>
Signed-off-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
@BradGroux

Copy link
Copy Markdown
Contributor Author

This is a replacement for #5308, which was accidentally closed when branches were force-pushed after a commit identity rewrite. Prior review comments and feedback are preserved on the old PR:

#5308

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 12e1e78 to 1f9c2ff Compare August 25, 2026 19:16
@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main (was 36 commits behind). The branch applied cleanly. The backup restore dialog still lacks a Continue button for raw nsec keys on current main, so this fix is still needed.

No review comments on this PR. CI will verify the build and test gate.

@BradGroux
BradGroux force-pushed the fix/desktop-backup-restore-raw-nsec branch from 1f9c2ff to 9f0c62d Compare August 29, 2026 16:15
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 00e61eafa917d296104006576b7a2ddbfd58bb5a...9f0c62d85b627302b3b1329427a1d02e43367199.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 9f0c62d85b627302b3b1329427a1d02e43367199 to authorize a new review.
Any previous review applies only to its recorded range.

@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main (was 62 commits behind at f249710, now at 00e61ea). The branch applies cleanly with all tests passing.

Still-needed assessment: No upstream commits in the 62-commit window address the same issue. This PR remains needed.

Review requests: buzz-oss-team review request is active from the previous pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop: backup-file restore accepts raw .key/nsec but renders no Continue action

1 participant